package com.project.pet.controller.wx;


import com.project.pet.common.ResponseData;
import com.project.pet.pojo.Comment;
import com.project.pet.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;

@RestController("wxCommentController")
@RequestMapping("/api/wx/comment")
public class CommentController {

    @Autowired
    private CommentService service;

    @PostMapping("/insert")
    public ResponseData<Object> insertSelective(@RequestBody Comment comment){
        return service.insert(comment);
    }
    @PostMapping("/query")
    public ResponseData<Object> pagingQuery(@RequestBody HashMap<String,Object> map){
        return service.pagingQuery(map);
    }

    @PostMapping("/update")
    public ResponseData<Object> updateByPrimaryKey(@RequestBody Comment comment){
        return service.updateByPrimaryKey(comment);
    }

    @PostMapping("/delete")
    public ResponseData<Object> delete(@RequestBody List<Integer> ids){
        return service.delete(ids);
    }

    @GetMapping("/selectAll")
    public ResponseData<Object> selectAll(){
        return service.selectAll();
    }

    @GetMapping("/selectByMap")
    public ResponseData<Object> selectByMap(@RequestBody HashMap<String,Object> map){
        return service.selectByMap(map);
    }

    @GetMapping("/select/{infoId}")
    public ResponseData<Object> selectByInfoId(@PathVariable  Integer infoId){
        return service.selectByInfoId(infoId);
    }

    @GetMapping("/selectReply")
    public ResponseData<Object> selectReply(){
        return service.selectReply();
    }

}